//
//  ViewController.m
//  bettaLogTenxun
//
//  Created by jing zhao on 5/20/15.
//  Copyright (c) 2015 jing zhao. All rights reserved.
//

#import "ViewController.h"
#import <TencentOpenAPI/TencentOAuth.h>
@interface ViewController ()<TencentSessionDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)logInTenxun:(id)sender {
    
    _tencentOAuth = [[TencentOAuth alloc] initWithAppId:@"222222" andDelegate:self];
    _tencentOAuth.redirectURI = @"www.qq.com";
   NSArray* permissions =  [NSArray arrayWithObjects:@"get_user_info", @"get_simple_userinfo", @"add_t", nil];
    [_tencentOAuth authorize:permissions inSafari:NO];
}

-(void)tencentDidNotNetWork
{
   
}

- (void)tencentDidLogin
{
    
    NSLog(@"%@",_tencentOAuth.accessToken);
    
}

-(void)tencentDidNotLogin:(BOOL)cancelled
{


}
@end
